\subsection{Free groups and presentations}
Consider \( \pi_1(S^1 \vee S^1, x_0) \) where \( x_0 \) is the wedge point.
The universal cover is the infinite 4-valent tree \( T_\infty(4) \), so \( \pi_1(S^1 \vee S^1) \) is in bijection with \( q^{-1}(x_0) \), the vertices of \( T_\infty(4) \).
Let \( \widetilde x_0 \) be one such vertex.
If \( \widetilde x \) is a vertex, there is a unique shortest path from \( \widetilde x_0 \) to \( \widetilde x \).
This gives an `address' for \( \widetilde x \) in \( T_\infty(4) \) given by recording the type and direction of each edge used in the path.
The set of such `addresses' is in bijection with the set of \emph{reduced words} \( w = \ell_1 \dots \ell_r \) where \( r \in \mathbb N \), and each \( l_i \) is one of \( a, a^{-1}, b, b^{-1} \), such that \( w \) does not contain any substring of the form \( aa^{-1}, a^{-1}a, bb^{-1} b^{-1}b \).
Then each word \( w \) corresponds to an element \( w \in \pi_1(S^1 \vee S^1, x_0) \), the image of the shortest path under \( q \).
Note that the multiplication \( ww' \) in \( \pi_1(S^1 \vee S^1, x_0) \) corresponds to concatenation of words \( ww' \) and then the reduction of substrings such as \( aa^{-1} \).
\begin{definition}
    A \emph{free group} with generating set \( S \) is a group \( F_S \) and a subset \( S \subseteq F_s \) such that if \( G \) is a group and \( \varphi \colon S \to G \) is a map of sets, there is a unique homomorphism \( \Phi \colon F_s \to G \) with \( \eval{\Phi}_S = \varphi \).
    \begin{center}
        \begin{tikzcd}
            & F_S \arrow[d, "\Phi", dashed] \\
            S \arrow[r, "\varphi"'] \arrow[ru] & G
        \end{tikzcd}
    \end{center}
\end{definition}
\begin{remark}
    The action of taking the free group of a set is a functor from \( \mathbfup{Set} \) to \( \mathbfup{Grp} \), and it is left adjoint to the forgetful functor from \( \mathbfup{Grp} \) to \( \mathbfup{Set} \).
    This property is known as the universal property of the free group.
\end{remark}
\begin{example}
    \( \pi_1(S^1 \vee S^1) \simeq F_{\qty{a,b}} \).
    Indeed, given \( \varphi \colon \qty{a,b} \to G \), we define \( \Phi(\ell_1 \dots \ell_r) = \varphi(\ell_1) \dots \varphi(\ell_r) \), where we extend \( \varphi \) to all of \( \qty{a, a^{-1}, b, b^{-1}} \) by defining \( \varphi(a^{-1}) = \varphi(a)^{-1} \) and \( \varphi(b^{-1}) = \varphi(b)^{-1} \).
    This is a homomorphism: indeed,
	\[ \Phi(ww') = \varphi(\ell_1) \dots \varphi(\ell_k) \varphi(\ell_1') \dots \varphi(\ell_k') = \Phi(w)\Phi(w') \]
	cancelling substrings of the form \( aa^{-1} \) as required.
	The homomorphism is unique as required for the universal property of the free group.
\end{example}
\begin{lemma}
	Let \( F_S, F_T \) be free groups on sets \( S \subseteq F_S, T \subseteq F_T \).
	Let \( \varphi \colon S \to T \) be a bijection.
	Then \( \Phi \colon F_S \to F_T \) is an isomorphism.
\end{lemma}
\begin{proof}
	Let \( \psi = \varphi^{-1} \).
	Since \( F_T \) is free, there exists a homomorphism \( \Psi \colon F_T \to F_S \) such that \( \eval{\Psi}_T = \psi \).
	Then \( \Psi \circ \Phi \colon F_S \to F_S \) has the property that for all \( s \in S \), we have \( \psi \circ \varphi(s) = s \).
	\( F_S \) is free, so there is a unique homomorphism \( \alpha \colon F_S \to F_S \) mapping \( s \in S \) to \( s \).
	So \( \alpha = \mathrm{id}_{F_S} \).
	Hence \( \Psi \circ \Phi = \mathrm{id}_{F_S} \), so by symmetry, they are inverse functions.
\end{proof}
\begin{corollary}
	If \( F_S, F_S' \) are free groups generated by \( S \), \( F_S \simeq F_S' \).
	So the isomorphism type of \( F_S \) depends only on \( \abs{S} \), the cardinality of \( S \).
\end{corollary}
We therefore can write \( F_n \) for \emph{the} free group (up to isomorphism) generated by \( n \) elements \( a_1, \dots, a_n \).
Let \( X = \bigvee_{i=1}^n S^1 \) where \( x_0 \) is the wedge point, with inclusion maps \( j_n \colon S^1 \to X \).
Let \( a_i = j_{i\star}(1) \) for \( 1 \in \pi_1(S^1,1) \) be a generator.
Then \( X \) has universal cover \( \widetilde X = T_\infty(2n) \), the infinite regular \( 2n \)-valent tree.
In particular, \( \pi_1(X,x_0) \) is the set of reduced words in \( \qty{a_1^{\pm 1}, \dots, a_n^{\pm 1}} \), which is isomorphic to \( F_{2n} \).

\subsection{Presentations}
\begin{definition}
	Let \( G \) be a group and \( S \subseteq G \) be a subset.
	Let \( \mathcal S_S = \qty{H \leq G \mid S \subseteq H} \), then let \( \genset S = \bigcap_{H \in \mathcal S_S} H \) be the smallest subgroup of \( G \) containing \( S \), known as the \emph{subgroup generated by \( S \)}.
	Similarly, let \( \mathcal N_S = \qty{N \trianglelefteq G \mid S \subseteq H} \), and let \( \ngenset S = \bigcap_{H \in \mathcal N_S} H \) be the smallest normal subgroup of \( G \) containing \( S \), called the \emph{subgroup normally generated by \( S \)}.
\end{definition}
Note that \( \genset S \) is nonempty since \( 1 \in H \) for all \( H \in \mathcal S_S \).

If \( \genset S = G \), we say that \( S \) \emph{generates} \( G \).
If so, there is a unique homomorphism \( \Phi_S \colon F_S \to G \) that maps \( s \) to \( s \).
\( \Im \Phi_S \leq G \), and it contains \( S \), so \( \Phi_S \) is surjective.
\begin{definition}
	Given a set \( S \) and \( R \subseteq F_S \), we define \( \genset{S\mid R} = \faktor{F_S}{\ngenset R} \).
	If in addition \( \ngenset R = \ker \Phi_S \), then \( G \simeq \faktor{F_S}{\ker \Phi_S} = \faktor{F_S}{\ngenset R} \).
	We say \( \genset{S\mid R} \) is a \emph{presentation} for \( G \).
\end{definition}
\begin{proposition}
	Any group \( G \) admits a presentation.
\end{proposition}
\begin{proof}
	Clearly \( \genset G = G \), so let \( S = G \).
	Let \( R = \ker \Phi_G \), where \( \Phi_G \colon F_G \to G \).
	Then by construction, \( \faktor{F_S}{\ngenset R} = \faktor{F_S}{\ker \Phi_G} \simeq G \).
\end{proof}
\begin{remark}
	These presentations are very large.
	It is often more useful to consider \emph{finite} presentations of \( G \), where both \( S \) and \( R \) are finite.
\end{remark}
\begin{example}
	\( \genset{a,b \mid} \simeq F_2 \).
	\( \genset{a \mid} \simeq F_1 = \pi_1(S^1,1) \simeq \mathbb Z \).
	\( \genset{a \mid a^3} \simeq \faktor{\mathbb Z}{3\mathbb Z} \).
	\( \genset{a, b \mid ab^{-3}} \simeq \mathbb Z \).
\end{example}
\begin{proposition}
	Let \( \genset{S\mid R} \) be a presentation, let $a \not\in S$, and let \( w \in F_S \).
	Then \( \genset{S \mid R} \simeq \genset{S \cup \qty{a} \mid R \cup \qty{aw^{-1}}} \).
\end{proposition}
\begin{proof}
	We have homomorphisms \( \varphi \colon \genset{S \mid R} \to \genset{S \cup \qty{a} \mid R \cup \qty{aw^{-1}}} \) mapping \( s \in S \) to \( s \), and \( \psi \colon \genset{S \cup \qty{a} \mid R \cup \qty{aw^{-1}}} \to \genset{S \mid R} \) mapping \( s \in S \) to \( s \) and \( a \) to \( w \).
	These are inverses.
\end{proof}
There are other operations we can apply to presentations.
If \( w \in R \), we can replace \( w \) with a conjugate \( sws^{-1} \) for \( s \in S \), and it leaves the group unchanged.
For example, \( \genset{ab \mid abb} = \genset{ab \mid bab} \).
Also, if \( w_1, w_2 \in R \), we can replace \( w_1 \) with \( w_1w_2 \), so for example,
\[ \genset{ab \mid babb, abb} = \genset{ab \mid b, abb} \simeq \genset{a \mid a} \simeq 1 \]
\begin{theorem}
	Given a finite set \( S \) and a finite set of relations \( R \subseteq F_S \), there is no algorithm to determine if \( \genset{S \mid R} \simeq 1 \).
\end{theorem}

\subsection{Covering with a pair of open sets}
\begin{theorem}
	Let \( U_1, U_2 \subseteq X \) be open, and \( U_1 \cap U_2 \) be path-connected with \( x_0 \in U_1 \cap U_2 \) and \( U_1 \cup U_2 = X \).
	Then \( \iota_{1\star}(\pi_1(U_1,x_0)) \cup \iota_{2\star}(\pi_1(U_2,x_0)) \) generates \( \pi_1(X,x_0) \), where \( \iota_i \colon U_i \to X \) is the inclusion.
\end{theorem}
\begin{proof}
	\( \qty{U_1, U_2} \) is an open cover of \( X \), so if \( \gamma \in \Omega(X,x_0) \), we have \( \qty{\gamma^{-1}(U_1), \gamma^{-1}(U_2)} \) is an open cover of \( I \).
	By the Lebesgue covering lemma, we can find \( n \in \mathbb N \) such that \( \qty[\frac{j}{n}, \frac{j+1}{n}] \) lies entirely inside \( \gamma^{-1}(U_1) \) or \( \gamma^{-1}(U_2) \) for all \( j \).
	Each interval \( \qty[\frac{j}{n}, \frac{j+1}{n}] \) with the label 1 or 2 accordingly; if it lies in both, choose an arbitrary label.
	Let \( 0 = t_0 < t_1 < \dots < t_k = 1 \) be the points of the form \( \frac{j}{n} \) where the labelling changes.
	Let \( I_i = [t_{i-1}, t_i] \) for each \( i \in \qty{0, \dots, k} \).
	Let \( \gamma_i = \eval{\gamma}_{I_i} \), so \( \gamma(t_i) \in U_1 \cap U_2 \), and \( \gamma(I_i) \subseteq U_{i \text{ mod } 2} \) without loss of generality.
	Note that we can write \( \gamma \) as the composition of paths \( \gamma = \gamma_1 \dots \gamma_k \).

	Let \( \eta_1, \dots, \eta_{k-1} \) be paths with \( \eta_i \in \Omega(U_1 \cap U_2, \gamma(t_i), x_0) \), which exists since \( U_1 \cap U_2 \) is path-connected.
	Then
	\[ \gamma \sim_e \gamma_1 \eta_1 \eta_1^{-1} \gamma_2 \eta_2 \eta_2^{-1} \dots \eta_{k-1} \eta_{k-1}^{-1} \gamma_k = \underbrace{\qty(\gamma_1 \eta_1)}_{\delta_1} \underbrace{\qty(\eta_1^{-1} \gamma_2 \eta_2)}_{\delta_2} \eta_2^{-1} \dots \eta_{k-1} \underbrace{\qty(\eta_{k-1}^{-1} \gamma_k)}_{\delta_k} \]
	Then each \( \delta_i \in \Omega_i(U_1, x_0) \), so \( [\delta_i] \in \Im \iota_{(i \text{ mod } 2)\star} \).
	So \( [\gamma] = [\delta_1][\delta_2]\dots[\delta_k] \) is a product of elements in \( \iota_{1\star}(\pi_1(U_1,x_0)) \cup \iota_{2\star}(\pi_1(U_2,x_0)) \), so \( [\gamma] \) lies in the subgroup they generate.
\end{proof}
\begin{corollary}
	Let \( U_1, U_2 \subseteq X \) be open and simply connected with \( U_1 \cup U_2 = X \), and let \( U_1 \cap U_2 \) be path-connected and contain \( x_0 \).
	Then \( X \) is simply connected.
\end{corollary}
\begin{proof}
	\( \pi_1(X,x_0) \) is generated by \( \iota_{1\star}(\pi_1(U_1,x_0)) \cup \iota_{2\star}(\pi_1(U_2,x_0)) = \qty{1} \).
\end{proof}
\begin{example}
	\( S^n = U^+ \cup U^- \), where \( U^+ = S^n = \qty{\qty(1, 0, \dots, 0)} \) and \( U^- = S^n - \qty{\qty(-1,0,\dots,0)} \).
	Then \( U^+ \simeq U^- \simeq \mathbb R^n \) by stereographic projection.
	\( U^+ \cap U^- \simeq \mathbb R^n - \qty{0} \).
	Hence \( \pi_1(U^\pm, x_0) = 1 \) since \( \mathbb R^n \) is contractible.
	\( U^+ \cap U^- \) is path-connected if \( n > 1 \), so \( \pi_1(S^n, x_0) = 1 \) for \( n > 1 \).
\end{example}
\begin{example}[attaching a disk]
	If \( f \colon S^1 \to X \) with \( f(1) = x_0 \), let \( X \cup_f D^2 = \faktor{X \amalg D^2}{\sim} \), where \( \sim \) is the smallest equivalence relation such that \( z \sim f(z) \) for \( z \in S^1 \).
	Let \( \pi \) be the quotient map from \( X \amalg D^2 \) to \( X \cup_f D^2 \).
	Then let \( U_1 = \pi(X \cup D^2 \setminus \qty{0}) \) and \( U_2 = \pi(D^2) \).
	Then \( U_1 \cup U_2 = X \cup_f D^2 \), and \( U_1 \cap U_2 = (D^2)^\circ \setminus \qty{0} \) is path-connected.
	\( \pi_1(U_2) = 1 \), so \( \pi_1(X \cup_f D^2) \) is generated by \( \pi_1(X) \).
	Note that \( f_\star \colon \pi_1(S^1, 1) \to \pi_1(X,x_0) \), so \( f_\star(1) \) lies in the kernel of the inclusion \( \pi_1(X,x_0) \to \pi_1(X \cup_f D^2, x_0) \), since \( f_\star(1) \) is null-homotopic in \( X \cup_f D^2 \).
	So \( \pi_1(X \cup_f D^2) \) surjects onto \( \faktor{\pi_1(X)}{\ngenset{f_\star(1)}} \).

	This is in fact an isomorphism.
	Suppose \( [\gamma] \in \pi_1(X \cup_f D^2, x_0) \) is mapped to the trivial element of \( \faktor{\pi_1(X)}{\ngenset{f_\star(1)}} \), so \( [\gamma] \) can be viewed as an element of \( \ngenset{f_\star(1)} \).
	Note that all such \( [\gamma] \) are of the form \( a_1 f_\star(n_1) a_1^{-1} \dots a_k f_\star(n_k) a_k^{-1} \).
	Since \( f_\star(n) = 1 \) in \( \pi_1(X \cup_f D^2, x_0) \), \( [\gamma] = 1 \).
\end{example}

\subsection{Amalgamated free products}
\begin{definition}
	Let \( \iota_1 \colon H \to G_1, \iota_2 \colon H \to G_2 \) be group homomorphisms.
	A group \( G \) is an \emph{amalgamated free product of \( G_1 \) and \( G_2 \) along \( H \)} if:
	\begin{enumerate}
		\item There are homomorphisms \( \varphi_1 \colon G_1 \to G, \varphi_2 \colon G_2 \to G \) such that the following diagram commutes.
		\begin{center}
			\begin{tikzcd}
				& G_1 \arrow[rd, "\varphi_1"]  &   \\
H \arrow[ru, "\iota_1"] \arrow[rd, "\iota_2"'] &                              & G \\
				& G_2 \arrow[ru, "\varphi_2"'] &
\end{tikzcd}
		\end{center}
		\item It is universal with this property, so for any other group \( \overline G \) with a commutative square as above, there is a unique homomorphism \( \psi \colon G \to \overline G \) such that the following diagram commutes.
		\begin{center}
			\begin{tikzcd}
				& G_1 \arrow[rrd, "j_1", bend left] \arrow[rd, "\varphi_1"']  &                             &             \\
H \arrow[ru, "\iota_1"] \arrow[rd, "\iota_2"'] &                                                             & G \arrow[r, "\psi", dashed] & \overline G \\
				& G_2 \arrow[rru, "j_2"', bend right] \arrow[ru, "\varphi_2"] &                             &
\end{tikzcd}
		\end{center}
	\end{enumerate}
\end{definition}
\begin{remark}
	The amalgamated free product is the colimit of the following diagram.
	\begin{center}
		\begin{tikzcd}
			& G_1 \\
H \arrow[ru, "\iota_1"] \arrow[rd, "\iota_2"'] &     \\
			& G_2
\end{tikzcd}
	\end{center}
	Hence, it is a categorical pushout.
\end{remark}
\begin{proposition}
	If \( G, G' \) are amalgamated products of \( G_1, G_2 \), then \( G \simeq G' \).
\end{proposition}
\begin{proof}
	There are homomorphisms \( \alpha \colon G \to G', \beta \colon G' \to G \), and the uniqueness in the definition implies \( \alpha \circ \beta = \mathrm{id}_{G'} \) and \( \beta \circ \alpha = \mathrm{id}_G \).
	In other words, the following diagram commutes.
	\begin{center}
		\begin{tikzcd}
			&                                            & G_1 \arrow[ld, "\varphi_1"'] \arrow[rd, "\varphi_1'"] &                                            \\
H \arrow[rru, "\iota_1", bend left] \arrow[rrd, "\iota_2"', bend right] & G \arrow[rr, "\alpha", dashed, shift left] &                                                       & G' \arrow[ll, "\beta", dashed, shift left] \\
			&                                            & G_2 \arrow[lu, "\varphi_2"] \arrow[ru, "\varphi_2'"'] &
\end{tikzcd}
	\end{center}
\end{proof}
\begin{proposition}
	An amalgamated product of any two groups exists.
\end{proposition}
The universal property of the presentation is that \( \genset{S \mid R} \simeq \faktor{F_S}{\ngenset{R}} \).
Suppose \( S \subseteq G \) satisfies the relations \( R \) in \( G \), so all of the relations map to the identity.
Then there is a unique homomorphism \( \genset{S \mid R} \to G \) mapping \( s \in S \) to \( s \), since there is a unique homomorphism \( F_S \to G \) mapping \( s \in S \) to \( s \), and since \( S \) satisfies the relations, this factors through \( \faktor{F_S}{\ngenset{R}} \).

For example, consider a map \( \genset{a \mid a^4} \to \faktor{\mathbb Z}{2\mathbb Z} \) that maps \( a \) to \( 1 \).
We can check that the relation \( 1^4 = 0 \) in \( \faktor{\mathbb Z}{2\mathbb Z} \) holds.
\begin{proof}
	Consider presentations \( G_i = \genset{S_i \mid R_i} \) of \( G_1, G_2 \), and \( H = \genset{T \mid W} \).
	Then define
	\[ G = G_1 \ast_H G_2 = \genset{S_1 \cup S_2 \cup T \mid R_1 \cup R_2 \cup \qty{t_i^{-1}\iota_1(t_i), t_i^{-1}\iota_2(t_i) \mid t_i \in T}} \]
	Then \( \varphi_i \colon G_i \to G \) are given by \( s \in S_i \) mapping to \( s \).
	Given \( j_1, j_2 \colon G_1, G_2 \to \overline G \), we define \( \psi \colon G \to \overline G \) mapping \( s \in S_1 \) to \( j_1(s) \), \( s \in S_2 \) to \( j_2(s) \), and \( t \in T \) to \( j_1 \circ \iota_1(t) = j_2 \circ \iota_2(t) \), and check that the relations hold.
\end{proof}
This is isomorphic to \( \genset{S_1 \cup S_2 \midd R_1 \cup R_2 \cup \qty{\iota_1(t_i) \iota_2^{-1}(t_i) \mid t_i \in T}} \).

\subsection{Seifert--Van Kampen theorem}
\begin{theorem}[Seifert--Van Kampen]
	Let \( X = U_1 \cup U_2 \) where \( U_i \) are open sets with \( U_1 \cap U_2 \) path-connected and containing \( x_0 \).
	Let \( G_i = \pi_1(U_i, x_0) \), and \( H = \pi_1(U_1 \cap U_2, x_0) \), so
	\begin{center}
		\begin{tikzcd}
			& U_1 \arrow[rd, "j_1"]  &   &  &                                                              & G_1 \arrow[rd, "j_{1\star}"]  &          \\
U_1 \cap U_2 \arrow[ru, "\iota_1"] \arrow[rd, "\iota_2"'] &                        & X &  & H \arrow[ru, "\iota_{1\star}"] \arrow[rd, "\iota_{2\star}"'] &                               & \pi_1(X) \\
			& U_2 \arrow[ru, "j_2"'] &   &  &                                                              & G_2 \arrow[ru, "j_{2\star}"'] &
\end{tikzcd}
	\end{center}
	Then \( \pi_1(X, x_0) = G_1 \ast_H G_2 \).
\end{theorem}
\begin{remark}
	The `easy' part of the proof is that we have a commutative diagram
	\begin{center}
		\begin{tikzcd}
			& G_1 \arrow[rrrd, "j_{1\star}", bend left] \arrow[rd, "\psi_1"']  &                                           &  &          \\
H \arrow[ru, "\iota_{1\star}"] \arrow[rd, "\iota_{2\star}"'] &                                                                  & G_1 \ast_H G_2 \arrow[rr, "\psi", dashed] &  & \pi_1(X) \\
			& G_2 \arrow[rrru, "j_{2\star}"', bend right] \arrow[ru, "\psi_2"] &                                           &  &
\end{tikzcd}
	\end{center}
	so we obtain a map \( \psi \colon G_1 \ast_H G_2 \to \pi_1(X,x_0) \) by universality of the amalgamated free product.
	Clearly \( \psi \) is surjective by the theorem in the previous subsection, and the difficult part of the proof is showing that \( \psi \) is injective.
\end{remark}
\begin{proof}[Proof sketch]
	We show that if \( H \colon I \times I \to X \) is a homotopy between \( \gamma_0 \) and \( \gamma_1 \), then \( [\gamma_0] = [\gamma_1] \) using the relations in \( G_1 \ast_H G_2 \).
	We can divide \( I \times I \) into squares of size \( \frac{1}{n} \) such that the image of each square under \( H \) lies in either \( U_1 \) or \( U_2 \) by the Lebesgue covering lemma.
	Each row represents a path \( \gamma_{\frac{i}{n}} \), and by operating row-by-row we will show \( \gamma_{\frac{i}{n}} \) is related to \( \gamma_{\frac{i+1}{n}} \) in \( G_1 \ast_H G_2 \).
	To move from one row to the next, if there are different labels above and below, the boundary lies in \( U_1 \cap U_2 \), so we use the relations \( \iota_{1\star}(t_1) = \iota_{2\star}(t_1) \).
\end{proof}
\begin{example}
	Consider \( X \cup_f D^2 = U_1 \cup U_2 \) where \( U_1 = X \cup_f D^2 \setminus \qty{0} \) and \( U_2 = (D^2)^\circ \), with \( x_0 \in U_1 \cap U_2 \).
	Let \( p \colon U_1 \to X \) be the inclusion.
	Since \( D^2 \setminus \qty{0} \) has a strong deformation retraction to \( S^1 \), we know \( U_1 \) has a strong deformation retraction to \( X \), so \( \pi_1(U_1,x_0) \simeq \pi_1(X,p(x_0)) \).
	Note that \( \pi_1(U_2,x_0) \) is the trivial group, since \( (D^2)^\circ \) is contractible.
	Note that \( U_1 \cap U_2 = (D^2)^\circ \setminus \qty{0} \) is homotopy equivalent to \( S^1 \), so \( \pi_1(U_1 \cap U_2,x_0) = \mathbb Z = \genset \gamma \).

	Then, by the Seifert--Van Kampen theorem, we have \( \pi_1(X \cup_f D^2) \simeq \pi_1(X) \ast_{\mathbb Z} 1 \).
	If \( \pi_1(X,x_0) = \genset{S \mid R} \), we have in particular that
	\[ \pi_1(X \cup_f D^2) \simeq \genset{S, t \midd R \cup \qty{t, t^{-1}f_\star(t)}} = \genset{S \mid R \cup{f_\star(t)}} = \faktor{\pi_1(X,x_0)}{\ngenset{f_\star(t)}} \]
\end{example}
\begin{example}
	Consider the torus \( T^2 = S^1 \vee S^1 \cup_f D^2 \).
	Let \( a, b \) be generators for \( \pi_1(S^1 \vee S^1) \).
	Then the commutator \( aba^{-1}b^{-1} \) represents the disk attached.
	So \( \pi_1(T^2) = \genset{a, b \mid aba^{-1}b^{-1}} = \mathbb Z^2 \).
\end{example}
\begin{example}
	Let \( \Sigma_g \) be a surface of genus \( g \).
	Then \( \Sigma_g = \bigvee_{i=1}^g (S^1 \vee S^1) \cup_f D^2 \), so
	\[ \pi_1(\Sigma_g) \simeq \genset{a_1,b_1,\dots, a_g, b_g \midd \prod_{i=1}^g a_i b_i a_i^{-1} b_i^{-1}} \]
\end{example}
\begin{example}
	A surface of genus two can be realised as a union of \( U_1, U_2 \) where \( U_1 \cap U_2 \simeq S^1 \) and \( \pi_1(U_i) = \genset{a_i,b_i} \), then \( \pi_1(\Sigma_2) = \genset{a_1,b_1} \ast_{\mathbb Z} \genset{a_2,b_2} \).
\end{example}
